package com.bwie.controller;
import com.bwie.pojo.GroupJoin;
import com.bwie.service.GroupJoinService;
import com.bwie.service.Impl.GroupJoinServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_group_join)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/prod/join")
public class GroupJoinController {
/**
* 服务对象
*/
    @Autowired
    private GroupJoinService groupJoinService;

    /**
     * 参与活动列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping(value = "/getGroupInfoList")
    public R getFroupInfoList(
            @RequestBody PageInfoVo pageInfoVo
            ){
        return groupJoinService.getGroupInfoList(pageInfoVo);
    }

    /**
     * 添加参团活动
     * @param groupJoin
     * @return
     */
    @PostMapping(value = "/addGroupInfo")
    public R addGroupInfo(
        @RequestBody GroupJoin groupJoin
    ){
        return groupJoinService.addGroupInfo(groupJoin);
    }

    /**
     * 修改
     * @param groupJoin
     * @return
     */
    @PostMapping(value = "/updateGroupInfo")
    public R updateGroupInfo(
        @RequestBody GroupJoin groupJoin
    ){
        return groupJoinService.updateGroupInfo(groupJoin);
    }

    /**
     * 删除
     * @param joinId
     * @return
     */
    @PostMapping(value = "/deleteGroupJoin/{joinId}")
    public R deleteGroupJoin(
            @PathVariable("joinId")Integer joinId
    ){
        return groupJoinService.deleteGroupJoin(joinId);
    }
}
